package cate.common.table.activity.specall.sheet;

import cate.common.table.ESheet;
import cate.common.table.activity.specall.row.SpeCallGroupRow;
import org.apache.commons.lang3.StringUtils;

import java.util.List;
import java.util.stream.Collectors;

public class SpeCallGroupSheet extends ESheet<SpeCallGroupRow> {
    @Override
    public String getSheetName() {
        return "卡池组";
    }

    public List<SpeCallGroupRow> getGroupRows(int group) {
        return getList().stream().filter(e -> e.group == group).collect(Collectors.toList());
    }

    public SpeCallGroupRow findUpRow(int group, String rewardStr){
        return getList().stream().filter(e -> e.group == group && StringUtils.equals(e.rewardStr, rewardStr)).findAny().orElse(null);
    }
}
